package com.banch.cloud.config.client.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * config client test controller
 *
 * @author banch
 * @version 1.0
 * @date 2020/7/23
 */
@RefreshScope
@Controller
@RequestMapping(value = "/configClient")
public class ConfigClientController {

    /**
     *
     */
    @Value("${config.info}")
    private String configInfo;

    @Value("${server.port}")
    private String serverPort;


    /**
     * description
     *
     * @param
     * @return
     * @author banch
     * @date 2020/7/23
     * @throw
     **/
    @ResponseBody
    @GetMapping("/configInfo")
    public String getConfigInfo() {
        return "serverPort:" + serverPort + "\t\n\n configInfo: " + configInfo;
    }

}